<%@page import="jwj8508.j2ee.basic.projectv5.dao.BoardDAO"%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<jsp:useBean id="b" class="jwj8508.j2ee.basic.projectv5.model.BoardVO" />
<jsp:setProperty property="*" name="b" />
<%
	b = BoardDAO.viewBoard(b);
%>
<style type="text/css">			
	#view {	width: 75%;	margin: 0 auto;	}
	label {
		display: inline-block;
		width: 10%;
		text-align: right;
		font-weight: bold;
		margin: 0 10px 10px 0;
	}
	.contents {	
		display: inline-block;
		width: 80%;
		height: 350px;
		overflow: auto;				
		padding: 0 10px 10px 10px;
	}
	.dragup { vertical-align: top; }
</style>
<div id="content">
	<h2>게시판 본문글</h2>
	<div id="view">
		<div><label>제목</label><span><%=b.getTitle() %></span></div>
		<div><label>작성자</label><span><%=b.getUid() %></span></div>
		<div><label>작성일</label><span><%=b.getWdate() %></span></div>
		<div><label>조회수</label><span><%=b.getReades() %></span></div>
		<div>
			<label class="dragup">본문</label>
			<span class="contents">
				<%=b.getContents().replace("\r\n", "<br />") %>
			</span>
		</div>
		<div>
			<label> </label>
			<button type="button" id="updbtn">수정하기</button>
			<button type="button" id="delbtn">삭제하기</button>
		</div>
	</div>
</div> <!-- content -->		
<script type="text/javascript">
	var deletebtn = document.getElementById("delbtn");
	deletebtn.onclick = function(){
		if(confirm('정말 삭제하시겠습니까?')) {					
			location.href="?action=deleteok&bdno=" + <%=b.getBdno() %>;
		}
	};
	var updatebtn = document.getElementById("updbtn");
	updatebtn.onclick = function(){
		if(confirm('정말 수정하시겠습니까?')) {
			//alert("수정 되었습니다.");
			//location.href="update.html";
			location.href="?action=update&bdno=" + <%=b.getBdno() %>;
		}
	};
</script>		